package com.icim.xmtm.dao;

import javax.annotation.Resource;

import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import com.icim.xmtm.entity.CtSlimifRetRacktHistory;

@Repository
public class CtSlimifRetRacktHistoryDao {
    @Resource
    private JdbcTemplate xmtmJdbcTemplate;

    public void save(CtSlimifRetRacktHistory data) {
//        String sql = "INSERT INTO CT_SLIMIFRETBOX (vendorcode,productspecname,thickness,targetproductspecname,"
        String sql = "INSERT INTO V_CT_SLIMIFRETTRACKTHISTORY_WG ("
            + "factoryname,"
            //+ "eventtimekey,"
            + "cus_info_snd,mtrl_prod_id_fk,"
                + "mtrl_box_id_fk,prd_seq_id,cr_tool_id_fk,evt_cate,evt_timestamp,evt_usr,cf_polish_time_spend,"
                + "tft_polish_time_spend,polish_pressure2,up_disk_frequency,down_disk_frequency,swing_range,axle_distance) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";

        xmtmJdbcTemplate.update(sql, new Object[] { 
            data.getFactoryname(),
            //data.getEventtimekey(),
            data.getCusInfoSnd(),
            data.getMtrlProdIdFk(),
            data.getMtrlBoxIdFk(),
            data.getPrdSeqId(),
            data.getCrToolIdFk(),
            data.getEvtCate(),
            data.getEvtTimestamp(),
            data.getEvtUsr(),
            data.getCfPolishTimeSpend(),
            data.getTftPolishTimeSpend(),
            data.getPolishPressure2(),
            data.getUpDiskFrequency(),
            data.getDownDiskFrequency(),
            data.getSwingRange(),
            data.getAxleDistance()});
    }
}
